Optimal. Leaf size=129 \[ -\frac {1}{2} \left (a^2+7 b^2\right ) x-\frac {4 a b \log (\cosh (c+d x))}{d}+\frac {3 b^2 \tanh (c+d x)}{d}+\frac {a b \tanh ^2(c+d x)}{d}+\frac {2 b^2 \tanh ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^5(c+d x)}{5 d}+\frac {\cosh (c+d x) \sinh (c+d x) \left (a^2+b^2+2 a b \tanh (c+d x)\right )}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 159, normalized size of antiderivative = 1.23, number of steps
used = 7, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3744, 1818,
1816, 647, 31} \begin {gather*} \frac {\left (a^2+7 b^2\right ) \tanh (c+d x)}{2 d}+\frac {\sinh ^2(c+d x) \left (\left (a^2+b^2\right ) \tanh (c+d x)+2 a b\right )}{2 d}+\frac {a b \tanh ^2(c+d x)}{d}+\frac {(a+b) (a+7 b) \log (1-\tanh (c+d x))}{4 d}-\frac {(a-7 b) (a-b) \log (\tanh (c+d x)+1)}{4 d}+\frac {b^2 \tanh ^5(c+d x)}{5 d}+\frac {2 b^2 \tanh ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 1816
Rule 1818
Rule 3744
Rubi steps
\begin {align*} \int \sinh ^2(c+d x) \left (a+b \tanh ^3(c+d x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {x^2 \left (a+b x^3\right )^2}{\left (1-x^2\right )^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\sinh ^2(c+d x) \left (2 a b+\left (a^2+b^2\right ) \tanh (c+d x)\right )}{2 d}+\frac {\text {Subst}\left (\int \frac {x \left (-4 a b-\left (a^2+3 b^2\right ) x-4 a b x^2-2 b^2 x^3-2 b^2 x^5\right )}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac {\sinh ^2(c+d x) \left (2 a b+\left (a^2+b^2\right ) \tanh (c+d x)\right )}{2 d}+\frac {\text {Subst}\left (\int \left (a^2+7 b^2+4 a b x+4 b^2 x^2+2 b^2 x^4-\frac {a^2+7 b^2+8 a b x}{1-x^2}\right ) \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac {\left (a^2+7 b^2\right ) \tanh (c+d x)}{2 d}+\frac {a b \tanh ^2(c+d x)}{d}+\frac {2 b^2 \tanh ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^5(c+d x)}{5 d}+\frac {\sinh ^2(c+d x) \left (2 a b+\left (a^2+b^2\right ) \tanh (c+d x)\right )}{2 d}-\frac {\text {Subst}\left (\int \frac {a^2+7 b^2+8 a b x}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac {\left (a^2+7 b^2\right ) \tanh (c+d x)}{2 d}+\frac {a b \tanh ^2(c+d x)}{d}+\frac {2 b^2 \tanh ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^5(c+d x)}{5 d}+\frac {\sinh ^2(c+d x) \left (2 a b+\left (a^2+b^2\right ) \tanh (c+d x)\right )}{2 d}+\frac {((a-7 b) (a-b)) \text {Subst}\left (\int \frac {1}{-1-x} \, dx,x,\tanh (c+d x)\right )}{4 d}-\frac {((a+b) (a+7 b)) \text {Subst}\left (\int \frac {1}{1-x} \, dx,x,\tanh (c+d x)\right )}{4 d}\\ &=\frac {(a+b) (a+7 b) \log (1-\tanh (c+d x))}{4 d}-\frac {(a-7 b) (a-b) \log (1+\tanh (c+d x))}{4 d}+\frac {\left (a^2+7 b^2\right ) \tanh (c+d x)}{2 d}+\frac {a b \tanh ^2(c+d x)}{d}+\frac {2 b^2 \tanh ^3(c+d x)}{3 d}+\frac {b^2 \tanh ^5(c+d x)}{5 d}+\frac {\sinh ^2(c+d x) \left (2 a b+\left (a^2+b^2\right ) \tanh (c+d x)\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.14, size = 137, normalized size = 1.06 \begin {gather*} \frac {-30 a^2 c-210 b^2 c-30 a^2 d x-210 b^2 d x+30 a b \cosh (2 (c+d x))-240 a b \log (\cosh (c+d x))+15 a^2 \sinh (2 (c+d x))+15 b^2 \sinh (2 (c+d x))+232 b^2 \tanh (c+d x)+12 b^2 \text {sech}^4(c+d x) \tanh (c+d x)-4 b \text {sech}^2(c+d x) (15 a+16 b \tanh (c+d x))}{60 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.63, size = 130, normalized size = 1.01
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\sinh \left (d x +c \right ) \cosh \left (d x +c \right )}{2}-\frac {d x}{2}-\frac {c}{2}\right )+2 a b \left (\frac {\sinh ^{4}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{2}}-2 \ln \left (\cosh \left (d x +c \right )\right )+\tanh ^{2}\left (d x +c \right )\right )+b^{2} \left (\frac {\sinh ^{7}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{5}}-\frac {7 d x}{2}-\frac {7 c}{2}+\frac {7 \tanh \left (d x +c \right )}{2}+\frac {7 \left (\tanh ^{3}\left (d x +c \right )\right )}{6}+\frac {7 \left (\tanh ^{5}\left (d x +c \right )\right )}{10}\right )}{d}\) | \(130\) |
default | \(\frac {a^{2} \left (\frac {\sinh \left (d x +c \right ) \cosh \left (d x +c \right )}{2}-\frac {d x}{2}-\frac {c}{2}\right )+2 a b \left (\frac {\sinh ^{4}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{2}}-2 \ln \left (\cosh \left (d x +c \right )\right )+\tanh ^{2}\left (d x +c \right )\right )+b^{2} \left (\frac {\sinh ^{7}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{5}}-\frac {7 d x}{2}-\frac {7 c}{2}+\frac {7 \tanh \left (d x +c \right )}{2}+\frac {7 \left (\tanh ^{3}\left (d x +c \right )\right )}{6}+\frac {7 \left (\tanh ^{5}\left (d x +c \right )\right )}{10}\right )}{d}\) | \(130\) |
risch | \(-\frac {a^{2} x}{2}+4 a b x -\frac {7 b^{2} x}{2}+\frac {{\mathrm e}^{2 d x +2 c} a^{2}}{8 d}+\frac {{\mathrm e}^{2 d x +2 c} a b}{4 d}+\frac {{\mathrm e}^{2 d x +2 c} b^{2}}{8 d}-\frac {{\mathrm e}^{-2 d x -2 c} a^{2}}{8 d}+\frac {{\mathrm e}^{-2 d x -2 c} a b}{4 d}-\frac {{\mathrm e}^{-2 d x -2 c} b^{2}}{8 d}+\frac {8 a b c}{d}-\frac {4 b \left (15 a \,{\mathrm e}^{8 d x +8 c}+45 b \,{\mathrm e}^{8 d x +8 c}+45 a \,{\mathrm e}^{6 d x +6 c}+120 b \,{\mathrm e}^{6 d x +6 c}+45 a \,{\mathrm e}^{4 d x +4 c}+170 b \,{\mathrm e}^{4 d x +4 c}+15 a \,{\mathrm e}^{2 d x +2 c}+100 b \,{\mathrm e}^{2 d x +2 c}+29 b \right )}{15 d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{5}}-\frac {4 a b \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d}\) | \(265\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 301 vs.
\(2 (121) = 242\).
time = 0.49, size = 301, normalized size = 2.33 \begin {gather*} -\frac {1}{8} \, a^{2} {\left (4 \, x - \frac {e^{\left (2 \, d x + 2 \, c\right )}}{d} + \frac {e^{\left (-2 \, d x - 2 \, c\right )}}{d}\right )} - \frac {1}{120} \, b^{2} {\left (\frac {420 \, {\left (d x + c\right )}}{d} + \frac {15 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d} - \frac {1003 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3350 \, e^{\left (-4 \, d x - 4 \, c\right )} + 5590 \, e^{\left (-6 \, d x - 6 \, c\right )} + 3915 \, e^{\left (-8 \, d x - 8 \, c\right )} + 1455 \, e^{\left (-10 \, d x - 10 \, c\right )} + 15}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 5 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 10 \, e^{\left (-8 \, d x - 8 \, c\right )} + 5 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )}\right )}}\right )} - \frac {1}{4} \, a b {\left (\frac {16 \, {\left (d x + c\right )}}{d} - \frac {e^{\left (-2 \, d x - 2 \, c\right )}}{d} + \frac {16 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} - \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )} - 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 1}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 2 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 3649 vs.
\(2 (121) = 242\).
time = 0.36, size = 3649, normalized size = 28.29 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tanh ^{3}{\left (c + d x \right )}\right )^{2} \sinh ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 296 vs.
\(2 (121) = 242\).
time = 0.55, size = 296, normalized size = 2.29 \begin {gather*} \frac {15 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )} + 30 \, a b e^{\left (2 \, d x + 2 \, c\right )} + 15 \, b^{2} e^{\left (2 \, d x + 2 \, c\right )} - 480 \, a b \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - 60 \, {\left (a^{2} - 8 \, a b + 7 \, b^{2}\right )} {\left (d x + c\right )} + 15 \, {\left (2 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )} - 16 \, a b e^{\left (2 \, d x + 2 \, c\right )} + 14 \, b^{2} e^{\left (2 \, d x + 2 \, c\right )} - a^{2} + 2 \, a b - b^{2}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + \frac {8 \, {\left (137 \, a b e^{\left (10 \, d x + 10 \, c\right )} + 625 \, a b e^{\left (8 \, d x + 8 \, c\right )} - 180 \, b^{2} e^{\left (8 \, d x + 8 \, c\right )} + 1190 \, a b e^{\left (6 \, d x + 6 \, c\right )} - 480 \, b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 1190 \, a b e^{\left (4 \, d x + 4 \, c\right )} - 680 \, b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 625 \, a b e^{\left (2 \, d x + 2 \, c\right )} - 400 \, b^{2} e^{\left (2 \, d x + 2 \, c\right )} + 137 \, a b - 116 \, b^{2}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.36, size = 306, normalized size = 2.37 \begin {gather*} \frac {{\mathrm {e}}^{2\,c+2\,d\,x}\,{\left (a+b\right )}^2}{8\,d}-\frac {4\,\left (3\,b^2+a\,b\right )}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-x\,\left (\frac {a^2}{2}-4\,a\,b+\frac {7\,b^2}{2}\right )+\frac {4\,\left (4\,b^2+a\,b\right )}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )}-\frac {64\,b^2}{3\,d\,\left (3\,{\mathrm {e}}^{2\,c+2\,d\,x}+3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}+1\right )}-\frac {{\mathrm {e}}^{-2\,c-2\,d\,x}\,{\left (a-b\right )}^2}{8\,d}+\frac {16\,b^2}{d\,\left (4\,{\mathrm {e}}^{2\,c+2\,d\,x}+6\,{\mathrm {e}}^{4\,c+4\,d\,x}+4\,{\mathrm {e}}^{6\,c+6\,d\,x}+{\mathrm {e}}^{8\,c+8\,d\,x}+1\right )}-\frac {32\,b^2}{5\,d\,\left (5\,{\mathrm {e}}^{2\,c+2\,d\,x}+10\,{\mathrm {e}}^{4\,c+4\,d\,x}+10\,{\mathrm {e}}^{6\,c+6\,d\,x}+5\,{\mathrm {e}}^{8\,c+8\,d\,x}+{\mathrm {e}}^{10\,c+10\,d\,x}+1\right )}-\frac {4\,a\,b\,\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+1\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________